//
//  NamespaceViewController.swift
//  cabbage_swift
//
//  Created by dfsx6 on 2021/10/8.
//

import UIKit

//MARK:-
class NamespaceViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.

//        let s = NamespaceItem.init()
//        s.router.route()
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}

//MARK:-
extension NamespaceViewController {
    
}

//MARK:-
class Router<NamespaceItem>: NSObject {
    private let item: NamespaceItem!
    
    init(item: NamespaceItem) {
        self.item = item
    }
    
    public func route() {
        let targetVC = WaterfallViewController.init()
        exTopVC?.navigationController?.pushViewController(targetVC, animated: true)
    }
}

//MARK:-
extension NamespaceItem {
    public var router: Router<NamespaceItem> {
        return Router<NamespaceItem>.init(item: self)
    }
}

//MARK:-
protocol NamespaceProtocol: NSObjectProtocol {
    associatedtype T
    var router: T { get }
    static var router: T.Type { get }
}

